package com.xinqi.common.core.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 用户状态枚举
 *
 * @version V1.0
 * @Title:用户状态枚举
 * @ClassName: com.xinqi.common.core.enums.UserStatusEnum.java
 * @Description:
 * @Copyright 2022-2023 www.xingqiclass.com - Powered By 星奇科技
 * @author: dgyu
 * @date: 2023-03-12 9:22
 */
public enum UserStatusEnum implements BaseEnum {
    /**
     * 正常
     */
    ENABLE("normal", "正常"),
    /**
     * 禁用
     */
    DISABLE("disable", "禁用");

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    UserStatusEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static UserStatusEnum of(String code) {
        return BaseEnum.of(UserStatusEnum.class, code);
    }
}
